<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>
  function fn1() {
    // es5
    //   严格模式 : undefined
    //   非严格模式 : 谁调用就指向谁
    // es6
    //   指向父级作用域
    console.log(this);
  }

  // fn1();

  let fn2 = () => {
    console.log(this);
  };

  // fn2();

  let obj = {
    fn1,
    fn2: function () {
      console.log(this);
      return function () {
        console.log(this);
        return () => {
          console.log(this);
          return function () {
            console.log(this);
          }
        }
      }
    }
  };

  obj.fn1();
  obj.fn2()()()(); //

</script>
</body>
</html>
